import { Http } from '@/common/api'

// ------------物料管理-------------------

export const materialPageListUrl = '/srm/material/page'
/**
 * 新增物料
 * @param params
 * @return {*|Promise}
 */
export const apiAddMaterial = async (params) => Http.post('/srm/material/add', params)

/**
 * 编辑物料
 * @param params
 * @return {*|Promise}
 */
export const apiEditMaterial = async (params) => Http.post('/srm/material/update', params)

/**
 * 删除
 * @param ids
 * @return {*|Promise}
 */
export const apiDeleteMaterial = async (params) => Http.delete('/srm/material/delete', params)

/**
 * 根据ID查询物料
 * @param id
 * @return {*|Promise}
 */
export const apiGetInfo = async (id) => Http.get(`/srm/type/findById/${id}`)

/**
 * 启用物料
 * @param id
 * @return {*|Promise}
 */
export const apiPutEnable = async (params) => Http.put('/srm/material/enable', params)

/**
 * 禁用物料
 * @param id
 * @return {*|Promise}
 */
export const apiPutDisable = async (params) => Http.put('/srm/material/disable', params)
/**
 * 导出物料数据
 * @param params
 * @return {*|Promise}
 */
export const exportUrl = '/upms/org/exportExcel'
